var e = require("../../../../@babel/runtime/helpers/typeof"), t = getApp();

Page({
    data: {
        language: "",
        memberInof: "",
        all_List: "",
        rewards_list: "",
        is_open: "",
        record_title: ""
    },
    onLoad: function(e) {
        this.checkrouter(), this.setData({
            is_open: ""
        }), this.getData(), this.isShowTask();
    },
    checkrouter: function() {
        try {
            var t = function() {
                for (var e = wx.getStorageSync("yz_basic_info"), t = e.popularize_page.mini.vue_route, n = 0; n < t.length; n++) if ("PartnershipTeam" == t[n]) return console.log(e.popularize_page.mini.mini_url + "跳转的路径"), 
                wx.showToast({
                    title: "未开启推广权限",
                    duration: 1e3,
                    icon: "none",
                    success: function() {
                        setTimeout(function() {
                            wx.redirectTo({
                                url: e.popularize_page.mini.mini_url
                            });
                        }, 1e3);
                    }
                }), {
                    v: void 0
                };
            }();
            if ("object" === e(t)) return t.v;
        } catch (e) {
            console.log(e);
        }
    },
    onReady: function() {
        var e = wx.getStorageSync("langIndex");
        this.setData({
            language: e.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    isShowTask: function() {
        var e = this, n = t.getNetAddresss("plugin.nominate.frontend.task.enable");
        t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                1 === n.result ? e.setData({
                    is_open: n.data.is_open
                }) : wx.showToast({
                    title: n.msg,
                    icon: "none"
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    getData: function() {
        var e = this, n = t.getNetAddresss("plugin.nominate.frontend.home.index");
        t._getNetWork({
            url: n,
            success: function(t) {
                var n = t.data;
                1 === n.result ? (e.setData({
                    all_List: n.data,
                    memberInof: n.data.member,
                    rewards_list: n.data.rewards,
                    record_title: n.data.plugin_name
                }), wx.setNavigationBarTitle({
                    title: n.data.plugin_name ? n.data.plugin_name : ""
                })) : wx.showToast({
                    title: n.msg,
                    icon: "none"
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    RewardDet: function(e) {
        var t = e.target.dataset.item || e.currentTarget.dataset.item;
        wx.navigateTo({
            url: "/packageB/member/enterprise/ManagementRecord/ManagementRecord?fromHome=1&name=" + t.identifying + "&reward_name=" + t.reward_name
        });
    },
    taskDet: function() {
        wx.navigateTo({
            url: "/packageB/member/enterprise/TaskList/TaskList"
        });
    }
});